Skip to content

Add equals() function #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 30, 2025
Merged

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Apr 28, 2025

PR Summary

Add equals() function needed for Bicep

Part of #767

@SteveL-MSFT SteveL-MSFT marked this pull request as ready for review April 28, 2025 23:22
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Apr 30, 2025
Merged via the queue into PowerShell:main with commit 04602e5 Apr 30, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the equals-function branch April 30, 2025 21:51
Copy link
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok it's great, and worked, but now I know we also need if (ducks).

2025-04-30T21:58:36.246997Z  INFO dsc_lib::configure: 668: Set parameter 'colorMode' to '"dark"'
2025-04-30T21:58:36.247609Z DEBUG dsc_lib::parser: 48: Parsing statement: [if(equals(parameters('colorMode'), 'light'), 1, 0)]
2025-04-30T21:58:36.248239Z DEBUG dsc_lib::parser: 84: Parsing expression
2025-04-30T21:58:36.248858Z DEBUG dsc_lib::parser::expressions: 43: Parsing function '{Node function (0, 1) - (0, 51)}'
2025-04-30T21:58:36.249478Z DEBUG dsc_lib::parser::expressions: 43: Parsing function '{Node function (0, 4) - (0, 44)}'
2025-04-30T21:58:36.250067Z DEBUG dsc_lib::parser::expressions: 43: Parsing function '{Node function (0, 11) - (0, 34)}'
2025-04-30T21:58:36.250790Z DEBUG dsc_lib::parser::functions: 57: Function name: 'parameters'
2025-04-30T21:58:36.253219Z DEBUG dsc_lib::parser::functions: 57: Function name: 'equals'
2025-04-30T21:58:36.253851Z DEBUG dsc_lib::parser::functions: 57: Function name: 'if'
2025-04-30T21:58:36.254457Z DEBUG dsc_lib::parser::functions: 75: Argument is an expression
2025-04-30T21:58:36.255039Z DEBUG dsc_lib::parser::functions: 75: Argument is an expression
2025-04-30T21:58:36.255623Z DEBUG dsc_lib::parser::functions: 80: Argument is a value: 'String("colorMode")'
2025-04-30T21:58:36.256278Z DEBUG dsc_lib::functions::parameters: 30: parameters function
2025-04-30T21:58:36.256900Z DEBUG dsc_lib::parser::functions: 80: Argument is a value: 'String("light")'
2025-04-30T21:58:36.257484Z DEBUG dsc_lib::parser::functions: 80: Argument is a value: 'Number(1)'
2025-04-30T21:58:36.266986Z DEBUG dsc_lib::parser::functions: 80: Argument is a value: 'Number(0)'
2025-04-30T21:58:36.267733Z ERROR dsc::subcommand: 370: Parameter input failure: Parser: Unknown function 'if'

Comment on lines +72 to +73
// TODO: Add tests for arrays once `createArray()` is implemented
// TODO: Add tests for objects once `createObject()` is implemented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, was going to ask based on the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants